package exam.zijie;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int q = scanner.nextInt();
        int[] nums = new int[n+1];
        int[] s = new int[n+1];
        String list = scanner.next();
        for(int i = 1;i<=n;i++){
            nums[i] = list.charAt(i-1)-'0';
        }
        for(int i = 1;i<=n;i++){
            s[i] =nums[i]-nums[i-1];
        }
        for(int i=0;i<q;i++){
            int l = scanner.nextInt();
            int r = scanner.nextInt();
            s[l]+=1;
            s[r+1]-=1;
        }
        for(int i = 1;i<=n;i++){
            s[i]+=s[i-1];
            System.out.print(s[i]%2);
        }
    }
}
